package org.example;

import java.io.IOException;
import java.util.Date;

public class Test {
    public static void main(String[] args) throws IOException {

        // 提取字符串中的数字
        String str = "abc123def456";
        String numStr = str.replaceAll("[^0-9]", "");
        System.out.println(numStr);

        // 提取字符串中的字母
        String str2 = "abc123def456";
        String letterStr = str2.replaceAll("[^a-zA-Z]", "");
        System.out.println(letterStr);

        // 1733393883000 时间戳转日期
        long timestamp = 1733393883000L;
        System.out.println(new Date(timestamp));
    }
}
